package org.nyt.medicalstore.dto;

import java.math.BigDecimal;
import java.util.Date;

public class SaleStatisticsDTO {
    private Long drugId;
    private String drugName;
    private Integer totalQuantity;
    private BigDecimal totalAmount;
    private Date startDate;
    private Date endDate;
    private Integer rank;  // 用于排行

    // Default constructor
    public SaleStatisticsDTO() {}

    // Constructor for JPQL queries
    public SaleStatisticsDTO(Long drugId, String drugName, Long totalQuantity, BigDecimal totalAmount, Date startDate, Date endDate) {
        this.drugId = drugId;
        this.drugName = drugName;
        this.totalQuantity = totalQuantity != null ? totalQuantity.intValue() : 0;
        this.totalAmount = totalAmount;
        this.startDate = startDate;
        this.endDate = endDate;
    }

    public Long getDrugId() { return drugId; }
    public void setDrugId(Long drugId) { this.drugId = drugId; }

    public String getDrugName() { return drugName; }
    public void setDrugName(String drugName) { this.drugName = drugName; }

    public Integer getTotalQuantity() { return totalQuantity; }
    public void setTotalQuantity(Integer totalQuantity) { this.totalQuantity = totalQuantity; }

    public BigDecimal getTotalAmount() { return totalAmount; }
    public void setTotalAmount(BigDecimal totalAmount) { this.totalAmount = totalAmount; }

    public Date getStartDate() { return startDate; }
    public void setStartDate(Date startDate) { this.startDate = startDate; }

    public Date getEndDate() { return endDate; }
    public void setEndDate(Date endDate) { this.endDate = endDate; }

    public Integer getRank() { return rank; }
    public void setRank(Integer rank) { this.rank = rank; }
}